package oj0424.oj0424_02;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = sc.nextInt();
        }
        for (int i = 0; i < n-1; i++) {
            for (int j =0; j< n -1;j++){
                if (data[j] > data[j+1]) {
                    int t = data[j];
                    data[j] = data[j+1];
                    data[j+1] = t;
                }
            }
            for (int k = 0;k<data.length;k++) {
                System.out.print(data[k]);
                if (k != data.length-1) System.out.print(" ");
            }
            System.out.println();
        }
        sc.close();
    }
}
